package com.yonyou.gmcc.gateway.web;

import java.util.UUID;

import org.apache.shiro.crypto.hash.Hash;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.ribbon.apache.RibbonLoadBalancingHttpClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

import com.netflix.loadbalancer.DynamicServerListLoadBalancer;
import com.netflix.util.Pair;
import com.yonyou.gmcc.gateway.web.jwt.JwtHelper;
import com.yonyou.gmcc.gateway.web.jwt.JwtOpenidHelper;

@EnableZuulProxy
@EnableDiscoveryClient
@SpringCloudApplication
public class WebGatewayApplication {

	public static void main(String[] args) {
//        String token=JwtHelper.createJWT("259name", "259", "", "", "", 1200*60);
//        System.out.println(token);
//        System.out.println("userid:"+JwtHelper.getUserId(token));
//        System.out.println("username:"+JwtHelper.getUserName(token));
        
//		String tok=JwtOpenidHelper.createJWT("136443322", "oxfdiasfj3", "", "", "", 24*60);
//		System.out.println(tok);
//		System.out.println("phone:"+JwtOpenidHelper.getPhone(tok));
//		System.out.println("openid"+JwtOpenidHelper.getOpenId(tok));
        //System.out.println(UUID.randomUUID().toString());
		SpringApplication.run(WebGatewayApplication.class, args);
	}
	
}
